package br.unipar.alunobuilder;

public class ProfessorBuilder {

    private Professor professor;

    public ProfessorBuilder() {
        professor = new Professor();
    }

    public ProfessorBuilder setNome(String nome) {
        professor.setNome(nome);
        return this;
    }

    public ProfessorBuilder setMatricula(String matricula) {
        professor.setMatricula(matricula);
        return this;
    }

    public Professor construir() {
        if (professor.getNome() == null) {
            return null;
        }
        if (professor.getMatricula() == null) {
            return null;
        }
        return professor;
    }

    public ProfessorBuilder setDisciplina(String disciplina) {
        professor.setDisciplina(disciplina);
        return this;
    }

}
